<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/fuman/js/oversea.js"></script>
<script>
function addorder()
{
	$('#addstorageform').modal('show');	
}
</script>
<title>销售项目列表</title>
<style type="text/css">
.stdtable tbody tr td{padding:3px 5px;}
</style>
<body class="withvernav">
<div class="bodywrapper"> {{include file='/public/leftmenu.tpl'}}
  <div class="centercontent">
    <div class="pageheader notab">
      <h1 class="pagetitle">项目商品销售报表</h1>
      <span class="pagedesc"></span>
       <div class="menulist">
        <ul class="profile_summary">
          <li> <a href="javascript:void(0)" onClick="addorder()" class=""><span>增加项目商品</span></a></li>
          <li><a href="/sales/salesProgramList"><span>返回项目列表</span></a></li>
        </ul>
      </div>
    </div>
    <!--pageheader-->
    
    <div id="contentwrapper" class="contentwrapper">
      <div id="basicform" class="subcontent">
          <!--搜索栏-->
           
    <form class="stdform stdform2" method="get" action="/sales/ajaxbutton">
    <div style="position:relative" class="tableoptions">
    	<input type="hidden" name="op" id="op" value="saleCounts">
        <input type="hidden" name="program_id" value="{{$program.id}}" />
      <div style="line-height:28px;"><strong>项目名称：</strong>{{$program.program_name}} &nbsp;<strong>负责人：{{$program.name}}</strong>&nbsp;&nbsp;订单时间段：<input type="text"  name="starttime" value="{{$starttime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /> - <input type="text"  name="endtime" value="{{$endtime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /><br>
 <strong>店铺：</strong><span id="search_list">{{$program.store_list}}</span>
 
 <div  align="right" style="position:absolute;z-index:2;top:1px;right:16px;" class="page"> {{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
 </div>
    </div>
    </form>
    <!--搜索栏结束-->
<table cellpadding="0" cellspacing="0" border="0" class="stdtable">
    <thead>
     <tr>
        <th colspan="9" class="head1">订单列表</th>
        <th  class="head1" align="right">&nbsp;</th>
      </tr>
    </thead>
    <tbody >
    <thead>
      <tr class="lbbt">
         <td bgcolor="#FEFFF1" >订单编号</td>
        <td  bgcolor="#FEFFF1" >店铺</td>
        <td  bgcolor="#FEFFF1" >状态</td>
        <td  bgcolor="#FEFFF1">买家帐号</td>
        <td  bgcolor="#FEFFF1" >商品金额</td>
        <td  bgcolor="#FEFFF1">商品编号</td>
        <td  bgcolor="#FEFFF1">货运方式</td>
        <td bgcolor="#FEFFF1">货运单号</td>
        <td  bgcolor="#FEFFF1">订单日期</td>
        <td  bgcolor="#FEFFF1">订单时间</td>
      </tr>
    </thead>
    {{foreach from=$sale_order_list item=li key=key}}
    <tr>
      <td valign="middle"  style="position:relative;"><a href="/orderlist/editorder?order_id={{$li.order_id}}" target="_blank">{{$li.order_sn}}</a></td>
      <td>{{$li.shopname}}</td>
      <td valign="middle" >{{if $li.order_status==1}}新订单{{/if}}
      {{if $li.order_status==2}}已支付{{/if}}
      {{if $li.order_status==3}}配货中{{/if}}
      {{if $li.order_status==4}}已发货{{/if}}
      {{if $li.order_status==5}}已完成{{/if}}
      {{if $li.order_status==6}}已作废{{/if}}</td>
      <td valign="middle" >{{$li.customerid}}</td>
      <td valign="middle" >{{$li.goods_amount}}</td>
      <td valign="middle" >{{$li.goods_sn}}</td>
      <td valign="middle" >{{$li.shipping_name}}</td>
       <td valign="middle" >{{$li.shipping_number}}</td>
       <td valign="middle" >{{$li.dates}}</td>
       <td valign="middle" >{{$li.ordertime}}</td>
    </tr>
    {{/foreach}}
    <tr>
    </tbody>
    </table>   
</div>
<div  align="right" class="page"> {{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
</div>

<form action="/sales/addProgramProducts"  method="post" name="attributeform" id="attributeform" >
  <div class="modal fade" id="addstorageform" tabindex="-1" role="dialog" aria-labelledby="returnaddattributeform" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="returnaddattributeform"> 添加项目商品</h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>所属项目：</td>
              <td align="left">{{$program.program_name}}</td>
            </tr>
            <tr>
              <td width="100">商品SKU号： </td>
              <td align="left"><textarea name="sku" id="sku" cols="10" rows="10"></textarea>
              <input type="hidden" name="program_id" value="{{$program.id}}" id="program_id"></td>
            </tr>
          
             <tr>
              <td>注意： </td>
              <td align="left">一行一个SKU商品编号</td>
            </tr>
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="button" class="btn btn-primary"  onclick="ajaxPostAddProduct()"> 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
  <!-- /.modal -->
</form>
<script language="javascript">
	function ajaxPostAddProduct(){/*
		var skuval=$("#sku").val();
		var program_idval=$("#program_id").val();
		$.post("/sales/addProgramProducts",{sku:skuval,program_id:program_idval},function(ret){
			alert(ret);
			if(ret.state==1){
			}else{
				alert(ret.msg);
			}
		},'html');(*/
		$("#attributeform").submit();
	}
</script>

</body>
</html>